package client;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class AccountPanel extends JPanel{

	public AccountPanel(User user){
		super(new BorderLayout());
		FilterPanel fp = new FilterPanel();
		SearchFilterPanel sp = new SearchFilterPanel(fp);
		Dimension d = new Dimension(HomePanel.xSize, HomePanel.ySize);
		sp.setSize(d);
		sp.setPreferredSize(d);
		add(sp, BorderLayout.EAST);
		JPanel up = new JPanel(new GridLayout(5,1));
		JPanel center = new JPanel(new BorderLayout());
		up.add(new Tuple("Name:", user.username));
		up.add(new Tuple("E-mail:", user.email));
		
		center.add(up, BorderLayout.NORTH);
		add(center, BorderLayout.CENTER);
	}
	
	private class Tuple extends JPanel{
		
		public Tuple(String desc, String value){
			super(new GridLayout(1,2));
			add(new JLabel(desc));
			add(new JLabel(value));
		}
		
	}
	
}
